import React from 'react';
import { lazy } from 'react';
import {
    HomeOutlined, DatabaseOutlined, MenuOutlined, ToTopOutlined, ShopOutlined, TeamOutlined ,PictureOutlined
  } from '@ant-design/icons';
import Home from "../views/home/Index"

  const menus = [
    {
      path: '/', // 路由
      key: '0-0', // 后续使用 - 权限管理
      title: '系统首页',
      icon: <HomeOutlined />,
      component:Home
    },
    {
      path: '/banner', // 路由
      key: '0-1', // 后续使用 - 权限管理
      title: '轮播图管理',
      icon: <DatabaseOutlined />,
      redirect: '/banner/list',
      children: [
        {
          path: '/banner/list',
          key: '0-1-0',
          title: '轮播图列表',
          icon: <MenuOutlined />,
          component:lazy(() => import("../views/banners/Index"))
        },
        {
          path: '/banner/add',
          key: '0-1-1',
          title: '添加轮播图',
          icon: <ToTopOutlined />,
          component:lazy(() => import("../views/banners/Add")),
          hidden: true // 不出现在左侧菜单栏
        }
      ]
    },
    {
      path: '/pro', // 路由
      key: '0-2', // 后续使用 - 权限管理
      title: '产品管理',
      icon: <ShopOutlined />,
      redirect: '/pro/list',
      children: [
        {
          path: '/pro/list',
          key: '0-2-0',
          title: '产品列表',
          icon: <MenuOutlined />,
          component:lazy(() => import("../views/pro/Index"))
        },
        {
          path: '/pro/seckill',
          key: '0-2-1',
          title: '秒杀列表',
          icon: <MenuOutlined />,
          component:lazy(() => import("../views/pro/Seckill"))
        },
        {
          path: '/pro/recommend',
          key: '0-2-2',
          title: '推荐列表',
          icon: <MenuOutlined />,
          component:lazy(() => import("../views/pro/Recommend"))
        },
        {
          path: '/pro/search',
          key: '0-2-3',
          title: '筛选列表',
          icon: <MenuOutlined />,
          component:lazy(() => import("../views/pro/Search"))
        }
      ]
    },
    {
      path: '/user',
      key: '0-3',
      title: '账户管理',
      icon: <TeamOutlined />,
      redirect: '/user/list',
      children: [
        {
          path: '/user/list',
          key: '0-3-0',
          title: '用户列表',
          icon: <MenuOutlined />,
          component:lazy(() => import("../views/user/Index"))
        },
        {
          path: '/user/admin',
          key: '0-3-1',
          title: '管理员列表',
          icon: <MenuOutlined />,
          component:lazy(() => import("../views/user/Admin"))
        }
      ]
    },
    {
      path:'/setting',
      key:'0-4',
      title:'设置',
      icon: <MenuOutlined />,
      component:lazy(() => import("../views/setting/Index")),
      hidden:true
    }, 
    {
      path:'/data',
      key: '0-5',
      title: '数据可视化',
      icon: <TeamOutlined />,
      redirect:'/data/Echarts',
      children: [
        {
          key: '0-5-0',
          path: '/data/Echarts',
          title: 'Echarts使用',
          icon: <MenuOutlined />,
          component:lazy(() => import('../views/data/Echarts.jsx'))
        },
        {
          key: '0-5-1',
          path: '/data/G2',
          title: 'G2charts使用',
          icon: <MenuOutlined />,
          component:lazy(() => import('../views/data/G2'))
        },
        {
          key: '0-5-2',
          path: '/data/Acharts',
          title: 'AntdCharts使用', 
          icon: <MenuOutlined />,
          component:lazy(() => import('../views/data/AntdCharts.jsx'))
        },
      ]

    },
    {
      key: '0-6',
      path: '/form',
      title: '编辑器',
      icon: <PictureOutlined />,
      redirect: '/form/editor',
      children: [
        {
          key: '0-6-0',
          path: '/form/editor',
          title: '富文本编辑器',
          icon: <MenuOutlined />,
          component: lazy(() => import('./../views/form/Editor.jsx'))
        },
        {
          key: '0-6-1',
          path: '/form/md',
          title: 'markdown 编辑器',
          icon: <MenuOutlined />,
          component: lazy(() => import('./../views/form/Md.jsx'))
        }
      ]
    },
    {
      key: '0-7',
      path: '/excel',
      title: '导入以及导出',
      icon: <MenuOutlined />,
      redirect: '/excel/import',
      children: [
        {
          key: '0-7-0',
          path: '/excel/import',
          title: '导入excel',
          icon: <MenuOutlined />,
          component: lazy(() => import('../views/excel/Import.jsx'))
        },
        {
          key: '0-7-1',
          path: '/excel/export',
          title: '导出excel',
          icon: <MenuOutlined />,
          component: lazy(() => import('../views/excel/Export.jsx'))
        }
      ]
    },
    {
      key: '0-8',
      path: '/map',
      title: '地图使用',
      icon: <PictureOutlined />,
      redirect: '/map/bmap',
      children: [
        {
          key: '0-8-0',
          path: '/map/bmap',
          title: '百度地图',
          icon: <MenuOutlined />,
          component: React.lazy(() => import('./../views/map/BMap.jsx'))
        },
        {
          key: '0-8-1',
          path: '/map/amap',
          title: '高德地图',
          icon: <MenuOutlined />,
          component: React.lazy(() => import('./../views/map/AMap.jsx'))
        },
        {
          key: '0-8-2',
          path: '/map/tmap',
          title: '腾讯地图',
          icon: <MenuOutlined />,
          component: React.lazy(() => import('./../views/map/TMap.jsx'))
        }
      ]
    }
  ]
  
  export default menus